/* Copyright (C) 2021 Rain */

/* This file is part of Panda. */

/* 
  Cunix is free software: you can redistribute it and/or modify 
  it under the terms of the GNU General Public License as published by 
  the Free Software Foundation, either version 3 of the License, or 
  (at your option) and later version. 
*/

/*
  Panda is distributed in the hope that it will be useful, 
  but WITHOUT ANY WARRANTY; without even the implied warranty of 
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
  GNU General Public License for more details. 
*/

/*
  You should have received a copy of the GNU General Public License 
   along with Panda. If not, see <https://www.gnu.org/licenses/>.  
*/




#ifndef __PANDA_H__
#define __PANDA_H__

#include <sys/types.h>


/* max word length */
#define MAX_WORD_LEN 64


int get_word(int, char *);
struct panda_syn_obj *syn_word(int);
int is_operator(char);
void *create_obj(int);


/* is this character (c) a digit? */
#define is_digit(c) ((c) >= '0' && (c) <= '9')

/* is this character (c) a letter? (letter or '_') */
#define is_letter(c) (((c) >= 'A' && (c) <= 'Z') || \
		((c) >= 'a' && (c) <= 'z') || \
		(c) == '_')



/* raise a syntax error */
#define syntax_error(msg, ...) printf("syntax error: "msg, ##__VA_ARGS__)


#endif

